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,CAAAJ,KAAO,CAAC,KAAAC,MAAW,CAACI,kBAAG,CAAAlB,CAAkB,EAClDD,CAA0B,GAEtCoB,WAAA,IAAAL,MAAA,IAAAlB,CAAA,CAAAmB,CAAA,IAAAC,GAAA,CAAAC,GAAA,CAAAE,WAAA,MAAAL,MAAA,CAAAI,kBAAA,CAAAlB,CAAA,EAAAD,CAAA,KAEL,GAAAP,CAAA,CAAAmB,GAAA,EAAAnB,CAAC,CAAAiB,QAAA,EAAeC,QACd,CAAc,GAAAlB,CAAY,CAAAmB,GAAA,EAAAjB,CAAA,CAAAkB,CAAA,EAC1Bb,YAAW,CAAEA,CAAW,CACxBC,WAAA,CAAAA,CAAiB,CACjBC,eAAA,CAAgBA,CAAE,CAClBC,gBAAc,CAAAA,CAAK,CACnBkB,YAAW,CAAE,GACbjB,WAAW,CAAEA,CAAW,CACxBC,WAAA,CAAAA,CAAgB,CAChBC,cAAS,CAAOA,CAAA,CAChBC,OAAA,CAAAA,CAAA,CACD,IAEL,CACH,GA2FDf,CAAA,IAAiCH,CAAA,YAAAK,CAAA,CAAA4B,IAAA,EAAAxB,CAAA,aAAAZ,CAAA,EAAAA,CAAA,CAAAqC,CAAA,+CAAArC,CAAA,CAAAA,CAAA,CAAAsC,CAAA,UAAAC,IAAA,CAAAvC,CAAA,CAAAqC,CAAA","sources":["webpack://_N_E/?c705","webpack://_N_E/./src/pages/product-list/[...slug].tsx","webpack://_N_E/"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/product-list/[...slug]\",\n function () {\n return require(\"private-next-pages/product-list/[...slug].tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/product-list/[...slug]\"])\n });\n }\n ","import React, { memo } from \"react\";\nimport { GetServerSideProps } from \"next\";\nimport ProductListPage from \"@components/views/ProductListPage\";\nimport { CategoryTypes } from \"@types\";\nimport SEO from \"@components/shared/SEO\";\nimport FetchPLPDetails from \"./fetchPLPDetails\";\nimport { getText } from \"~/src/libs/resources\";\nimport { getSessionid } from \"~/src/utilities/getSessionid\";\nimport { processQueryFilters } from \"../../constants/getQueryFilters\";\nimport { getFormateFilterList } from \"~/src/constants/getFormateFilterList\";\n\nconst productList = ({\n mainCategory,\n subCategory,\n plpProductsList,\n formatFilterList,\n isStorePage,\n isGuestUser,\n customerStatus,\n errors,\n payload,\n}: CategoryTypes) => {\n return (\n <>\n \n <>\n \n \n \n );\n};\n\nexport const getServerSideProps: GetServerSideProps = async ({\n query,\n req,\n resolvedUrl,\n}) => {\n const timeTaken = new Date();\n try {\n const sessionId = getSessionid(req);\n let isGuestUser =\n sessionId === undefined || sessionId === \"\" ? true : false;\n const slug = resolvedUrl.includes(\"?\")\n ? resolvedUrl?.split(\"?\")[0].split(\"/\")\n : resolvedUrl.split(\"/\");\n\n const queryFilters = resolvedUrl?.split(\"?\")[1] || \"\";\n const queryFiltersList = queryFilters?.includes(\"&\")\n ? queryFilters?.split(\"&\")\n : [queryFilters];\n\n let mainCategory,\n subCategory = \"\";\n\n if (decodeURIComponent(resolvedUrl?.split(\"?\")[0]).indexOf(\" /\") >= 0) {\n if (slug[2] === \"brands\") {\n mainCategory = slug[2];\n subCategory = slug.slice(3).join(\"/\");\n } else {\n mainCategory = slug[2] + \"/\" + slug[3];\n subCategory = slug[4] || \"\";\n }\n } else {\n mainCategory = slug[2] || \"\";\n subCategory = slug[3] || \"\";\n }\n const isStorePage = mainCategory === \"brands\";\n mainCategory = decodeURIComponent(mainCategory as string);\n subCategory = decodeURIComponent(subCategory as string);\n const isHagglePage = mainCategory === \"Haggle Rewards\";\n \n const filters = processQueryFilters(queryFiltersList);\n const payload = {\n category:\n mainCategory !== \"Food\" &&\n mainCategory !== \"Non-Food\" &&\n !isStorePage &&\n !isHagglePage\n ? mainCategory\n : null,\n sub_category: !isStorePage && !isHagglePage ? subCategory : null,\n brand: isStorePage ? subCategory : null,\n only_haggle_products: isHagglePage ? true : null,\n food:\n mainCategory === \"Food\"\n ? true\n : mainCategory === \"Non-Food\"\n ? false\n : null,\n filters: {},\n };\n let { plpProductsList, customerStatus, errors, filterList } =\n await FetchPLPDetails(sessionId, isGuestUser, payload, filters);\n if (!customerStatus?.is_authenticated) {\n isGuestUser = true;\n } else {\n isGuestUser = false;\n }\n const formatFilterList = getFormateFilterList(filterList);\n return {\n props: {\n mainCategory,\n subCategory,\n plpProductsList,\n formatFilterList,\n isStorePage,\n isGuestUser,\n customerStatus,\n errors,\n payload,\n },\n };\n } catch (error) {\n const now = Date.now();\n const duration = now - timeTaken.getTime();\n console.error(\"Unable to load PLP from SSR\", error, \"duration:\", duration);\n return {\n props: { error },\n };\n }\n};\nexport default memo(productList);\n","(self[\"webpackChunk_N_E\"] = self[\"webpackChunk_N_E\"] || []).push([[885],{\n\n/***/ 40761:\n/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {\n\n\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/product-list/[...slug]\",\n function () {\n return __webpack_require__(83294);\n }\n ]);\n if(false) {}\n \n\n/***/ }),\n\n/***/ 83294:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"__N_SSP\": function() { return /* binding */ __N_SSP; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85893);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67294);\n/* harmony import */ var _components_views_ProductListPage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3587);\n/* harmony import */ var _components_shared_SEO__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34853);\n/* harmony import */ var _src_libs_resources__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41090);\n\n\n\n\n\nvar productList = function(param) {\n var mainCategory = param.mainCategory, subCategory = param.subCategory, plpProductsList = param.plpProductsList, formatFilterList = param.formatFilterList, isStorePage = param.isStorePage, isGuestUser = param.isGuestUser, customerStatus = param.customerStatus, errors = param.errors, payload = param.payload;\n return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n children: [\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_shared_SEO__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .Z, {\n title: \"\".concat((0,_src_libs_resources__WEBPACK_IMPORTED_MODULE_4__/* .getText */ .Q)().PLP.SEO.title, \" \").concat(decodeURIComponent(subCategory ? subCategory : mainCategory)),\n description: \"\".concat((0,_src_libs_resources__WEBPACK_IMPORTED_MODULE_4__/* .getText */ .Q)().PLP.SEO.description, \" \").concat(decodeURIComponent(subCategory ? subCategory : mainCategory))\n }),\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_views_ProductListPage__WEBPACK_IMPORTED_MODULE_2__/* [\"default\"] */ .Z, {\n mainCategory: mainCategory,\n subCategory: subCategory,\n plpProductsList: plpProductsList,\n formatFilterList: formatFilterList,\n isSearchPage: false,\n isStorePage: isStorePage,\n isGuestUser: isGuestUser,\n customerStatus: customerStatus,\n payload: payload\n })\n })\n ]\n });\n};\nvar __N_SSP = true;\n/* harmony default export */ __webpack_exports__[\"default\"] = (/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(productList));\n\n\n/***/ })\n\n},\n/******/ function(__webpack_require__) { // webpackRuntimeModules\n/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }\n/******/ __webpack_require__.O(0, [9376,3587,9774,2888,179], function() { return __webpack_exec__(40761); });\n/******/ var __webpack_exports__ = __webpack_require__.O();\n/******/ _N_E = __webpack_exports__;\n/******/ }\n]);"],"names":["self","push","__unused_webpack_module","__unused_webpack_exports","__webpack_require__","window","__NEXT_P","__webpack_exports__","r","d","__N_SSP","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","react__WEBPACK_IMPORTED_MODULE_1__","_components_views_ProductListPage__WEBPACK_IMPORTED_MODULE_2__","_components_shared_SEO__WEBPACK_IMPORTED_MODULE_3__","_src_libs_resources__WEBPACK_IMPORTED_MODULE_4__","productList","param","mainCategory","subCategory","plpProductsList","formatFilterList","isStorePage","isGuestUser","customerStatus","payload","errors","jsxs","Fragment","children","jsx","Z","title","concat","Q","PLP","SEO","decodeURIComponent","description","isSearchPage","memo","O","s","_N_E"],"sourceRoot":""}